package org.minproject.my_library_back.controller;

import jakarta.annotation.Resource;
import org.minproject.my_library_back.common.CommonResponse;
import org.minproject.my_library_back.domain.User;
import org.minproject.my_library_back.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Resource
    private UserService usersService;

    //根据userid获取用户信息
    @GetMapping("/users/{id}")
    public CommonResponse<User> getUserByUserid(@PathVariable("id") String userid) throws Exception{
        return usersService.getUserByUserid(userid);
    }
}
